< previous page page_266 next page >

Page 266
Next, you tell the entire Division node and its children to remain expanded (TreeView nodes can be expanded and collapsed) in this line:
MyNode.EnsureVisible
(You also could have set each Division node's Expanded property to True.)
The last thing that deserves attention is the way the TabStrip reports back which tab has been clicked. In the TabStrip control, tabs are an array of tabs. So, when you click a tab, you are actually selecting a tab, like selecting a ListIndex in a ListBox control. In light of this knowledge, if you want to find out which tab is being clicked, the following line should make a bit more sense to you:
nTemp = tsMain.SelectedItem.Index
In this example, you simply get the index of the selected tab and store it in the variable nTemp.
Accepting User Input
Several of the Windows Common controls offer different ways to accept user input. For example, displaying a calendar when users want to input dates is not necessary, but it makes your program look very professional. One of the great benefits of Visual Basic's many controls is that you can quickly create a sharp-looking program by bringing together prebuilt objects. In this section, you will review the following controls:
ImageCombo, which is a graphical combo box
MonthView, which is a calendar control
DTPicker, which is a date combo box
UpDown, which is used to enhance numeric input.
Slider, which is used to input numbers graphically
Using an ImageCombo Control
One of the new controls in Visual Basic 6.0 is the ImageCombo control. From a user interface standpoint, the ImageControl serves the same purpose as the standard ComboBox control discussed in Chapter 4, "Using Visual Basic's Default Controls." However, the image combo box allows you to add pictures beside each item in the combo box's drop-down list, as pictured in Figure 12.16.
0266-01.jpg
Figure 12.16
An ImageCombo looks sharper
than a standard combo box.

 
< previous page page_266 next page >